package net.entelijan.cobean.util;

import java.util.Random;

public class RandomNameFactory {

    private Random ran = new Random();

    private int maxLen = 30;

    private static String[] syllabes = { "wo", "lf", "ga", "ng", "di", "ts", "chi", "no", "ah" };

    public RandomNameFactory() {
        super();
    }

    public String nextWord() {
        int len = ran.nextInt(this.maxLen);
        StringBuilder re = new StringBuilder();
        while (re.length() <= len) {
            re.append(randomSyllabe());
        }
        return re.toString().substring(0, len);
    }

    private String randomSyllabe() {
        return syllabes[ran.nextInt(syllabes.length)];
    }
}
